<template>
<div class="avue-sidebar">
  <logo></logo>
  <el-scrollbar style="height:100%">
    <el-menu unique-opened :default-active="nowTagValue" mode="vertical" :show-timeout="200" background-color="#20222a" text-color="rgba(255,255,255,0.7)" :collapse="isCollapse">
      <sidebar-item :menu="menu" first :screen="screen" :props="website.menu.props" :collapse="isCollapse"></sidebar-item>
    </el-menu>
  </el-scrollbar>
</div>
</template>

<script>
import {
  mapGetters
} from 'vuex'
import logo from '../logo';
import sidebarItem from './sidebarItem'
//import sidebarItem from './item'


export default {
  name: 'sidebar',
  components: {
    sidebarItem,
    logo
  },
  data() {
    return {}
  },
  created() {},
  computed: {
    ...mapGetters(['website', 'menu', 'tag', 'isCollapse', 'screen']),
    nowTagValue: function () {
      const val = this.$router.$avueRouter.getValue(this.$route)
      return val
    }
  },
  mounted() {
    this.$store.dispatch("GetMenu").then(data => {
      if (data.length === 0) return
      this.$router.$avueRouter.formatRoutes(data, true)
    })
  },
  methods: {}
}
</script>

<style lang="scss" scoped>
</style>
